tests: Make the deployment mutable in test-sysroot.js
authorMatthew Leeds <matthew.leeds@endlessm.com>
Wed, 30 Aug 2017 19:06:45 +0000 (12:06 -0700)
committerAtomic Bot <atomic-devel@projectatomic.io>
Thu, 31 Aug 2017 11:57:46 +0000 (11:57 +0000)
commit93d2590c35c6e302c52a4bfce23712a06ed732f2
tree3ec4526f662e356a820215018b940d77cbca88da
parent138c4d7aaea9956ea686fb8d6fe13557e0ac4d6e
tests: Make the deployment mutable in test-sysroot.js

We attempt to make deployments mutable in the test suite (as opposed to
immutable which is the default) to make it easier to chmod and clean up
the tmp files after each test. This is normally accomplished by setting
OSTREE_SYSROOT_DEBUG=mutable-deployments in libtest.sh, but that only
affects the environment variables for that bash instance, not the
process running gjs. So in test-sysroot.js OSTREE_SYSROOT_DEBUG wasn't
set when sysroot.deploy_tree() was called, which means the deployment
was made immutable which eventually causes the test to fail. This only
occurs when the test is run by the root user because for non-root users
_ostree_linuxfs_fd_alter_immutable_flag() would silently fail and the
deployment would be mutable.

This commit fixes this issue by setting the environment variable in
tests/test-sysroot.js.

Closes: #1122
Approved by: cgwalters
tests/test-sysroot.js